using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Easy.Geo.Kml
{
    public class StyleMap : StyleSelector
    {
        public StyleMap() : base() { }        
        public StyleMap(string id):base(id)
        {
            this._pairs = new List<Pair>();
        }
        private List<Pair> _pairs;
        [XmlElement(ElementName="Pair",Type=typeof(Pair))]
        public List<Pair> Pairs
        {
            get { return _pairs; }
            set { _pairs = value; }
        }

        public void AddPair(Pair pair)
        {
            this._pairs.Add(pair);
        }

        public Pair AddPair(StyleState key, string styleUrl)
        {
            Pair pair = new Pair(key, styleUrl);
            this.AddPair(pair);
            return pair;
        }
    }
}
